﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace Zhaoxi.SqlSugar.Models
{
    [Tenant("db2")] // 通过这个特性实现跨库查询操作 - db2是数据库ConfigId
    public class OrderItem
    {
        [SugarColumn(IsPrimaryKey = true)]
        public int ItemId { get; set; }
        public int OrderId { get; set; }
        public decimal? Price { get; set; }
        [SugarColumn(IsNullable = true)]
        public DateTime? CreateTime { get; set; }
        [Navigate(NavigateType.OneToOne, nameof(OrderId))] //设置关系 对应Order表主键 - 导航属性协助跨库查询操作
        public OrderHead? Order { get; set; }
    }
}
